package com.ruoyi.ruoyiqywechat.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ruoyiqywechat.mapper.MembershipPlanNewMapper;
import com.ruoyi.ruoyiqywechat.domain.MembershipPlanNew;
import com.ruoyi.ruoyiqywechat.service.IMembershipPlanNewService;

/**
 * 会员套餐Service业务层处理
 * 
 * @author 好六
 * @date 2025-10-10
 */
@Service
public class MembershipPlanNewServiceImpl implements IMembershipPlanNewService 
{
    @Autowired
    private MembershipPlanNewMapper membershipPlanNewMapper;

    /**
     * 查询会员套餐
     * 
     * @param id 会员套餐主键
     * @return 会员套餐
     */
    @Override
    public MembershipPlanNew selectMembershipPlanNewById(Long id)
    {
        return membershipPlanNewMapper.selectMembershipPlanNewById(id);
    }

    /**
     * 查询会员套餐列表
     * 
     * @param membershipPlanNew 会员套餐
     * @return 会员套餐
     */
    @Override
    public List<MembershipPlanNew> selectMembershipPlanNewList(MembershipPlanNew membershipPlanNew)
    {
        return membershipPlanNewMapper.selectMembershipPlanNewList(membershipPlanNew);
    }

    /**
     * 新增会员套餐
     * 
     * @param membershipPlanNew 会员套餐
     * @return 结果
     */
    @Override
    public int insertMembershipPlanNew(MembershipPlanNew membershipPlanNew)
    {
        membershipPlanNew.setCreateTime(DateUtils.getNowDate());
        return membershipPlanNewMapper.insertMembershipPlanNew(membershipPlanNew);
    }

    /**
     * 修改会员套餐
     * 
     * @param membershipPlanNew 会员套餐
     * @return 结果
     */
    @Override
    public int updateMembershipPlanNew(MembershipPlanNew membershipPlanNew)
    {
        membershipPlanNew.setUpdateTime(DateUtils.getNowDate());
        return membershipPlanNewMapper.updateMembershipPlanNew(membershipPlanNew);
    }

    /**
     * 批量删除会员套餐
     * 
     * @param ids 需要删除的会员套餐主键
     * @return 结果
     */
    @Override
    public int deleteMembershipPlanNewByIds(Long[] ids)
    {
        return membershipPlanNewMapper.deleteMembershipPlanNewByIds(ids);
    }

    /**
     * 删除会员套餐信息
     * 
     * @param id 会员套餐主键
     * @return 结果
     */
    @Override
    public int deleteMembershipPlanNewById(Long id)
    {
        return membershipPlanNewMapper.deleteMembershipPlanNewById(id);
    }
}
